from beamsearch_solution import beam_solution
from astar_solution      import astar_solution
from problems            import *
from heuristics          import *
import matplotlib.pyplot as plt
from numpy               import arange 




""" 
testing beamsearch for average n random problems up to size 4, with different beam sizes up to in [beams, beams + 25], for speed, with h = manhattan_dirt
"""
times = []
beams=25
n=4

for beam in xrange(1,beams):
    s_ = beam_solution(manhattan_dirt(),beam+25)
    time = 0
    for j in range(n):
        p = random_problem(4)
        t,s=s_.solve(p)
        time += t
    times.append(time/n-1)
 
plt.ylabel('time')
plt.xlabel('#beams')        

plt.plot(arange(1,beams),times)
plt.show()

        
    